clear all
cd "data"

use canvasser_endline_baseline_clean_ismp2_phone.dta, replace
gen universe = "imm_phone"

append using canvasser_endline_baseline_clean_ismp2_canvass.dta
replace universe = "imm_canvass" if missing(universe)

append using partisan_canvasser_endline_baseline_clean.dta
replace universe = "partisan_canvass" if missing(universe)

replace t0_female = t0_gender_female if missing(t0_female)
replace t0_poc = 0 if t0_race_white == 1 & missing(t0_poc)
replace t0_poc = 1 if t0_race_white == 0 & missing(t0_poc)
replace t0_ideo_very_liberal = t0_ideology == 5 if missing(t0_ideo_very_liberal)
replace t0_ideo_liberal = t0_ideology == 4 if missing(t0_ideo_liberal)
replace t0_ideo_moderate = t0_ideology == 3 if missing(t0_ideo_moderate)

encode universe, gen(study)

local covars t0_female t0_poc t0_age t0_ideo_very_liberal t0_ideo_liberal t0_ideo_moderate ///
	t0_therm_dem_voters t0_therm_trump_voters t0_prior_campaign_experience
	
foreach var of varlist `covars' {
	disp "`var'"
	assert !missing(`var')
}

reg t1_respondent `covars' i.study, vce(hc3)

tabstat t0_age t0_poc, by(t1_respondent)

keep if inlist(universe, "imm_canvass", "imm_phone")

reg t1_respondent door_ls_first_rating i.study if missing_door_rating != 1, vce(hc3)
